﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Umbrella.Whs.WhsAddin.ConsoleTabControls
{
    internal partial class Users : ConsoleTabControlBase
    {

        protected override void InitializeState(AddinState state)
        {
            base.InitializeState(state);

            switch (state)
            {
                case AddinState.Ready:
                    this.flowLayoutPanel.Controls.Add(new ConsoleControls.UsersList(_tab));
                    break;

                default:
                    _log.Error("state is not valid for console tab: " + state);
                    break;
            }
        }

        public Users(UmbrellaConsoleTab tab)
            : base(tab)
        {
            if (_log.IsDebugEnabled)
                _log.Debug("Initialization start");

            try
            {
                InitializeComponent();

                // done
                if (_log.IsDebugEnabled)
                    _log.Debug("Initialization done");
            }
            catch (Exception e)
            {
                _log.Fatal("Failed to initialize", e);

                throw;
            }
        }
    }
}
